package com.hu.biz.signature;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author 00351634
 * @version 1.0
 * @date 2024/10/15 9:14
 * @description: 加密配置文件
 */
@Data
@Component
@ConfigurationProperties(prefix = "chery.signature")
public class SignatureProperties {

    private boolean enabled;
    /** 签名有效期，默认3分钟，单位秒 */
    private Long validTime = 180L;
    private List<Platform> platform;

    // Getters and Setters

    public boolean isEnabled() {
        return enabled;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public Long getValidTime() {
        return validTime;
    }

    public void setValidTime(Long validTime) {
        this.validTime = validTime;
    }

    public List<Platform> getPlatform() {
        return platform;
    }

    public void setPlatform(List<Platform> platform) {
        this.platform = platform;
    }

    public static class Platform {
        private String appId;
        private String url;

        // Getters and Setters

        public String getAppId() {
            return appId;
        }

        public void setAppId(String appId) {
            this.appId = appId;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }
    }
}
